<script src="../js/equal.js"></script>
<script>
  // 1
  {
    let [a, b, c] = 'abc' // <--
    console.assert(equal([a, b, c], ['a', 'b', 'c']), '1. 失败')
  }

  // 2
  {
    const [x, , z] = 'ab' // <--
    console.assert(z === undefined, '2. 失败')
  }

  // 3
  {
    const [space, , coffee] = 'a ☕' // <--
    console.assert(coffee === '\u{2615}', '3. 失败')
  }

  // 4
  {
    const { length: len, ...ha } = 'hahaha' // <--
    console.assert(
      len === 6 &&
        equal(ha, { 0: 'h', 1: 'a', 2: 'h', 3: 'a', 4: 'h', 5: 'a' }),
      '4. 失败'
    )
  }
</script>
